getaddrinfo-is-threadsafe
authorSteve Langasek <vorlon@debian.org>
Tue, 28 Apr 2020 17:18:12 +0000 (18:18 +0100)
committerRyan Tandy <ryan@nardis.ca>
Tue, 28 Apr 2020 17:18:12 +0000 (18:18 +0100)
commit877b12d82c3b48095165d3669b4c513af50c6a59
tree6a4787a308b0fd7ccebccaa79b5179017bb917fe
parentd3fa246766bbb568dfc8798e0a7b0e9672f3a6dc
getaddrinfo-is-threadsafe

OpenLDAP upstream conservatively assumes that certain resolver functions
(getaddrinfo, getnameinfo, res_query, dn_expand) are not re-entrant; but we
know that the glibc implementations of these functions are thread-safe, so
we should bypass the use of this mutex.  This fixes a locking problem when
an application uses libldap and libnss-ldap is also used for hosts
resolution.

Closes Debian bug #340601.

Not suitable for forwarding upstream; might be made suitable by adding a
configure-time check for glibc and disabling the mutex only on known
thread-safe implementations.

Gbp-Pq: Name getaddrinfo-is-threadsafe
libraries/libldap/os-ip.c
libraries/libldap/util-int.c